package edu.uw.nemo.esu;

import java.util.*;

public class GenUtil {

    public List<String[]> setupAL() {
        List<String[]> input = new ArrayList<String[]>();
        input.add(new String[]{"1", "2"});
        input.add(new String[]{"1", "3"});
        input.add(new String[]{"1", "4"});
        input.add(new String[]{"1", "5"});
        input.add(new String[]{"2", "3"});
        input.add(new String[]{"2", "6"});
        input.add(new String[]{"2", "7"});
        input.add(new String[]{"3", "8"});
        input.add(new String[]{"3", "9"});
        return input;
    }

    public List<String[]> setupAL2() {
        List<String[]> input = new ArrayList<String[]>();
        input.add(new String[]{"1", "2"});
        input.add(new String[]{"1", "3"});
        input.add(new String[]{"1", "5"});
        input.add(new String[]{"2", "3"});
        input.add(new String[]{"2", "4"});
        input.add(new String[]{"2", "6"});
        input.add(new String[]{"2", "7"});
        input.add(new String[]{"3", "8"});
        input.add(new String[]{"3", "9"});
        return input;
    }

    void printCombinations(List<int[]> actual) {
        for (int i = 0; i < actual.size(); i++) {
            int[] cur = actual.get(i);
            int length = cur.length;
            for (int j = 0; j < length; j++) {
                System.out.print(cur[j]);
                if (j < length - 1) {
                    System.out.print(" -> ");
                }
            }
            System.out.println("");
        }
        System.out.println("\ntotal [" + actual.size() + "] elements.");
    }

    void printCombinations(List<int[]> actual, int x) {
        for (int i = 0; i < actual.size(); i++) {
            int[] cur = actual.get(i);
            int length = cur.length;
            for (int j = 0; j < length; j++) {
                System.out.print(cur[j]);
                if (j < length - 1) {
                    System.out.print(" -> ");
                }
            }
            System.out.println("");
        }
        System.out.println("\ntotal [" + actual.size() + "] elements.");
    }

    public void print(byte[] actual) {
        for (int j = 0; j < actual.length; j++) {
            System.out.print(actual[j] + " ");
        }
        System.out.println("");
    }

    private void setupAdjMappings(Map<Integer, Set<Integer>> adjMapping, int id1, int id2) {
        Set<Integer> aSet = adjMapping.get(id1);
        if (aSet == null) {
            aSet = new HashSet<Integer>();
            adjMapping.put(id1, aSet);
        }
        aSet.add(id2);
    }

}
